package cn.le.springAnnotationCustomize.annotationUtil;

import org.springframework.validation.Errors;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;

/**
 * Created by admin on 2017/3/30.
 * 自定义注解处理器接口
 */
public interface CustomerValidatorRule {

    /**
     * 判断是否支持该注解
     * @param annotation
     * @return
     */
    public boolean support(Annotation annotation);

    /**
     * 校验处理
     * @param annotation
     * @param object
     * @param field
     * @param errors
     * @throws Exception
     */
    public void valid(Annotation annotation, Object object, Field field, Errors errors) throws Exception;

}
